﻿using System;
using DAL;
using VO;
using COMMON;

namespace BLL
{
    public class BlacklistBLL
    {

        #region Insert
        public static Retorno<Blacklist> Insert(Blacklist obj)
        {
            var objReturn = new Retorno<Blacklist>();
            try
            {
                //Insere Campanha
                new BlacklistDAL().Insert(obj);
                objReturn.Error = Enumerator.Error.Success;
                objReturn.Message = "OK";
            }
            catch (Exception ex)
            {
                objReturn.Error = Enumerator.Error.Failed;
                objReturn.Message = ex.Message;
            }
            return objReturn;
        }
        #endregion

        #region Delete
        public static Retorno<Blacklist> Delete(int idBlacklist)
        {
            var objReturn = new Retorno<Blacklist>();
            try
            {
                //Deleta Campanha
                new BlacklistDAL().Delete(idBlacklist);
                objReturn.Error = Enumerator.Error.Success;
                objReturn.Message = "OK";
            }
            catch (Exception ex)
            {
                objReturn.Error = Enumerator.Error.Failed;
                objReturn.Message = ex.Message;
            }
            return objReturn;
        }
        #endregion

        #region Select
        public static Retorno<Blacklist> Select()
        {
            var objReturn = new Retorno<Blacklist>();
            try
            {
                //Lista blacklist
                objReturn.List = new BlacklistDAL().Select();
                objReturn.Error = Enumerator.Error.Success;
                objReturn.Message = "OK";
            }
            catch (Exception ex)
            {
                objReturn.Error = Enumerator.Error.Failed;
                objReturn.Message = ex.Message;
            }
            return objReturn;
        }
        #endregion

    }
}